package servicebase

import (
	"github.com/fhmq/hmq/broker"
	"jkgo/jk/jklog"
)

type SSIoTServer struct {
	broker  *broker.Broker
	config *broker.Config
}

func NewSSIoTServer(addr string, port int) (*SSIoTServer, error) {
	ss := &SSIoTServer{}
	args := []string{}
	ss.config, _ = broker.ConfigureConfig(args)
	ss.config.Debug = true

	var err error
	ss.broker, err = broker.NewBroker(ss.config)
	if err != nil {
		jklog.L().Errorln("New Broker error: ", err)
		return nil, err
	}
	ss.broker.Start()
	return ss, nil
}

